const arr = [
	{
		id:1,
		username:"zhangsan"
	},{
		id:2,
		username:"lisi"
	}
]

// const info = arr.find(v=>v.id === 4);
// console.log(info?.username);

// || 左侧为false,那么会将||右侧作为表达式的值
const info = arr.find(v=>v.id === 4) || {}
console.log(info.username)